/*
 * utility.h
 *
 *  Created on: 2009-1-13
 *      Author: fanliangliang
 */

#ifndef UTILITY_H_
#define UTILITY_H_

#include <vector>
#include <string>
#include <limits>

using std::string;
using std::vector;

// return true if the file represented by pathname is a directory
bool isDirectory(const string& pathname);

size_t getFileSize(const string& pathname);

size_t getFileSizeWithPattern(const string& pathname, const string& pattern);

size_t getFileSizeWithPatternEx(const string& pathname, const string& pattern);

void traverseDirectory(vector<string>& result, const string& pathname, size_t depth = 0);

void traverseDirectoryWithPattern(vector<string>& result, const string& pattern, const string& pathname, size_t depth = 0);

bool deleteFile(const string& pathname);

string getCurrentDirectory();

#endif /* UTILITY_H_ */
